package com.itheima.tanhua.vo.mongo;

import cn.hutool.core.convert.Convert;
import com.itheima.tanhua.pojo.db.Question;
import com.itheima.tanhua.pojo.db.SoulQuestion;
import com.itheima.tanhua.pojo.soul.TbTestsoul;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class TestSoulVo implements Serializable {

    private static final long serialVersionUID =  772150L;
    String id;//问卷编号
    String name;//问卷名称
    String cover;//封面
    String level;//级别
    Integer star;//星级（2颗星，3颗星）
    List<SoulQuestion> questions;//测试体(非必须)
    Integer isLock;//是否锁住（0解锁，1锁住）
    String reportId;//最新报告id（非必须）

    public static TestSoulVo tobeTestVo(TbTestsoul tbTestsoul){
        String id = tbTestsoul.getId()+"";
        String name = tbTestsoul.getName() + "";
        String cover = tbTestsoul.getCover();
        String level = tbTestsoul.getLevel();
        Integer star = tbTestsoul.getStar();
        Integer isLock = tbTestsoul.getIsLock();
        String reportId = Convert.toStr(tbTestsoul.getReportId());
        return new TestSoulVo(id,name,cover,level,star,null,isLock,reportId);
    }
}
